#ifndef ORDER_H
#define ORDER_H

#include <string>
#include <vector>
#include "ompl/util/RandomNumbers.h"

namespace customer {

struct Order {
  int table;
  explicit Order(int table) : table(table) {}
};

class OrderSimulator {
  static const int OUTPUT_LIMIT = 4;
  int max_tables;
  mutable ompl::RNG rng;

public:
  OrderSimulator(int max_tables): max_tables(max_tables)
    {
    if (max_tables < 1) {
      throw std::invalid_argument("invalid number of tables");
    }
  }

  std::vector<Order> getOrders() const {
    // select tables
    std::vector<Order> orders;
    int count = rng.uniformInt( 1, OUTPUT_LIMIT );
    for (int i = 0; i < count; ++i) {
      int t = rng.uniformInt( 0, max_tables - 1 );
      orders.push_back(Order(t));
    }
    return orders;
  }
};

} // namespace customer

#endif
